<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>游记表单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" th:href="@{/layuiadmin/layui/css/layui.css}" media="all"/>
    <link rel="stylesheet" th:href="@{/layuiadmin/style/admin.css}" media="all"/>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-list" id="layuiadmin-form-list" style="padding: 20px 30px 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">游记标题</label>
        <div class="layui-input-block" style="width: 40%;">
            <input type="text" id="title" disabled="disabled" name="title" lay-verify="required" placeholder="请输入游记标题"
                   autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">发帖人</label>
        <div class="layui-input-block" style="width: 40%;">
            <input type="text" id="nickname" disabled="disabled" name="nickname" lay-verify="required"
                   placeholder="请输入用户名" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">文章头图</label>
        <div class="layui-input-inline" style="width: 40%;">
            <input name="headImgUrl" disabled="disabled" id="LAY_headImgSrc" placeholder=""
                   autocomplete="off" class="layui-input">
        </div>
        <div class="layui-input-inline layui-btn-container" style="width: auto;">
            <!--<button type="button" class="layui-btn layui-btn-primary" id="LAY_headImgUpload">-->
            <!--<i class="layui-icon">&#xe67c;</i>上传图片-->
            <!--</button>-->
            <button class="layui-btn layui-btn-primary" layadmin-event="headImgPreview">查看图片
            </button>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">游记内容</label>
        <div class="layui-input-block" style="width: 80%;">
			<textarea id="content" disabled="disabled" name="content" lay-verify="required" autocomplete="off"
                      class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-app-forum-submit" id="LAY-app-forum-submit" value="通过审核">
    </div>
</div>

<script th:src="@{/layuiadmin/layui/layui.js}"></script>
<script>
    layui.config({
        base: '../../../layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form', 'set', 'layedit'], function () {
        var $ = layui.$
            , form = layui.form
            , layedit = layui.layedit;


        // layedit set
        layedit.set({
            uploadImage: {
                url: '/file/upload'
                , type: 'post'
            }
            , height: 900
        });

        //富文本编辑器
        var id = layedit.build('content');

        form.verify({
            content: function (value) {
                return layedit.sync(id);
            }
        });


    })
</script>
</body>
</html>